// 检查用户是否登录
const checkLoginMiddleware = (req, res, next) => {
  // 判断用户是否登录
  if (!req.session.username) {
    return res.redirect('/login')
  }
  next()
}

module.exports = checkLoginMiddleware
